home *** CD-ROM | disk | FTP | other *** search
- Chapter 8
-
- Other QEMM-386 Programs
-
- This chapter describes two other QEMM programs, EMS2EXT and EMS,
- which give additional control over expanded memory. These two
- programs can be used separately or they can be used together to
- give you some dynamic control over your extended memory
- allocation.
-
- If your system has EMS 4.0 expanded memory, but not extended
- memory, you may want to use the EMS2EXT.SYS device driver
- supplied with QEMM. EMS2EXT can supply expanded memory as
- extended memory to programs that access extended memory in a
- certain prescribed manner. Two such programs are IBM's
- DisplayWrite and the VDISK.SYS RAM disk utility supplied with
- DOS. Many disk cache utilities often use extended memory in this
- way also.
-
- ~Subhead~ EMS2EXT.SYS
-
- These and other programs can be used with EMS2EXT.SYS because
- they do not require that extended memory (memory above 1024K) be
- physically present, nor do they need to directly address this
- memory. They make demands upon this memory in a logical as
- opposed to a physical sense. And they access the contents of this
- memory through requests of a memory manager, which makes this
- memory available to the program. Programs which make use of
- extended memory in this way provide a performance boost over
- programs that rely on disk storage alone, since the in-memory
- transfer is much faster.
-
- Programs that expect extended memory to be physically present
- cannot make use of EMS2EXT. Quarterdeck's QEXT.SYS driver, used
- with DESQview, cannot use memory supplied by EMS2EXT.
-
- Because this logical or virtual memory capability enhances a
- programs performance, you should have little difficulty in
- determining which of your applications support this memory. They
- will surely mention it. And, if your complement of expanded
- memory lends itself to this use, you will want to make this
- memory available to these programs.
-
- If you decide to use EMS2EXT you may also want to consider the
- relative speed of the various types of memory you have in your
- system. It is possible for there to be a significant speed
- differential between these types of memory. EMS2EXT is capable of
- determining this difference and can allocate either slow memory
- or fast memory for use as extended memory.
-
- EMS2EXT is a device driver and therefore needs to be loaded when
- your system boots up. This requires a DEVICE= statement in your
- CONFIG.SYS file. When you have determined the amount of memory to
- ask EMS2EXT to manage as extended memory, you need to modify
- CONFIG.SYS to load EMS2EXT. The statement to load EMS2EXT must
- come after the one that loads your expanded memory manager and
- looks like:
-
- DEVICE=C:\QEMM\EMS2EXT.SYS MEMORY=nnn speed
-
- Several components of this statement need to be explained.
-
- ~Item~ The nnn parameter in MEMORY=nnn is the number of kilobytes
- of expanded memory to allocate, i.e. MEMORY=512. This is
- optional.
-
- ~Item~ The speed parameter is the optional specification for
- using faster or slower memory for allocation. Leave this part of
- the line blank or use either, FAST or SLOW.
-
- ~Subhead~ The EMS Programs
-
- The EMS programs provide a number of informative and powerful
- functions to help you make the best use of your EMS 4.0 expanded
- memory where you might have special or unusual requirements.
- Although anyone might benefit from the EMS summary status report
- and others by seeing the detail of expanded memory allocation,
- other uses of EMS which will be described in these sections are
- for the more technically minded.
-
- Most of the functions of the two EMS programs, EMS.SYS and
- EMS.COM, involve the manipulation of expanded memory handles. An
- EMS handle is a reference to a block of memory (zero or more EMS
- pages) that the expanded memory manager issues when it allocates
- memory. A handle is represented by a number and it may be given a
- name.
-
- An expanded memory handle, its name, and the pages of memory
- associated with the handle are the fundamental tokens of
- interaction between an application program and an expanded memory
- manager. The two EMS programs give you some of the same control
- functions available to programs. The principal need for caution
- when using the EMS programs arises because they give you access
- to handles which may belong to other programs and EMS will not
- prevent you from inadvertent mischief making.
-
- With the EMS programs you can allocate and name a block of memory
- with the CREATE option, and specify that the memory be fast or
- slow memory. You can free expanded memory pages allocated to a
- handle with the FREE option. You can read data from a file into
- allocated expanded memory or write the data from allocated
- expanded memory to a file with the LOAD or SAVE options. An EMS
- handle can be renamed, and the number of memory pages can be
- changed.
-
- Along with the report features of EMS you can experiment with the
- functions using EMS as a command line interface to the expanded
- memory manager.
-
- If parts of the expanded memory in your system runs at different
- speeds, you can use EMS to pre-allocate memory of one speed
- before you load a device driver or TSR so that it can only use
- the memory that remains at the other speed; and you can then free
- the memory for use by your other applications. Quarterdeck
- Manifest can show you if your memory runs at different rates.
-
- Developers using expanded memory may make use of the LOAD and
- SAVE function to help them when they need to work with the same
- context repeatedly during development and debugging.
-
- All of these uses of EMS require an extensive knowledge of the
- various aspects of your system, from the details involved in the
- DOS boot sequence, to uses and capabilites of expanded and
- extended memory as well as an understanding of the applications
- you are attempting to control and optimize.
-
- Both EMS.SYS and EMS.COM respond to the same command line
- options. You use EMS.SYS from within the CONFIG.SYS file to
- manipulate expanded memory during the system boot sequence. You
- use EMS.COM from within the AUTOEXEC.BAT file at the end of the
- boot sequence or directly from DOS prompt as needed.
-
- Described below are the command line options of EMS and the
- parameters required by each option. Some of the options have an
- abbreviated form. Where this is the case, the alternate form is
- shown immediately following the option when it is first
- introduced, and is enclosed in parentheses.
-
- To get a summary report of your expanded memory, you issue the
- EMS command from the command line without any option specified.
- EMS outputs the following information:
-
- ~Item~ the total amount of expanded memory, and
-
- ~Item~ the amount currently available, and
-
- ~Item~ the address of the Page Frame.
-
- The DIR option displays, in tabular form, a breakdown of the
- current expanded memory allocated. For each allocated handle, the
- number of expanded memory pages is given, the number of kilobytes
- of memory those pages represent, and the name assigned to that
- handle, if any.
-
- The CREATE (CR) option is used to allocate pages of expanded
- memory. It takes two parameters. CREATE requires that you provide
- a name for the memory you are allocating and that you specify the
- amount of memory. The name may be one to eight characters long.
- The name need not be enclosed in quotation marks unless it
- contains blanks. The amount of memory you are allocating may be
- expressed in EMS pages (16K per page) or in kilobytes. If you
- specify the number of kilobytes, the memory manager will round
- the number up if necessary to determine the number of pages.
- Follow the EMS CREATE command with EMS DIR command to confirm the
- allocation and to determine the handle number assigned to the
- name.
-
- The CREATEFAST (CFAST) and CREATESLOW (CSLOW) options are forms
- of the CREATE option that also instruct the memory manager to
- allocate the memory from either faster or slower memory. Use
- Manifest's Expanded Memory Timings to determine if this form of
- CREATE is important to you.
-
- The FREE option frees memory and deallocates a handle. FREE
- requires that you specify the handle to deallocate~dash~by its
- name or its number.
-
- The RENAME (REN) option lets you assign a new name to a handle.
- The first parameter to RENAME is the original handle. You may
- refer to this handle by its number or its name. The second
- argument is the new handle name.
-
- The RESIZE (RES) option lets you increase or decrease the number
- of pages assigned to a handle. Its two arguments are the same as
- those of CREATE.
-
- The SAVE option allows you to save the contents of the expanded
- memory pages associated with an EMS handle to a file. This option
- requires that you also specify the handle name (or number) and
- the file name.
-
- The LOAD option allows you to restore the contents of expanded
- memory pages that have been stored in a file. This option
- requires that you also specify the handle name (or number) and
- the file name which contains the data you want to restore. The
- number of pages required will be automatically allocated based on
- the files size.
-
- The EMS programs also respond to the options common to all the
- programs supplied with your QEMM-386 programs:
-
- ~Item~ NOPAUSEONERROR (NOPE) instructs EMS not to pause on error.
-
- ~Item~ PAUSE instructs the program to pause while parsing
- commands.
-
- ~Item~ HELP displays EMS help text.
-
- ~Item~ ? lists all EMS command parameters.
-
- ~Subhead~ Using EMS with EMS2EXT
-
- You can load EMS2EXT as described in the EMS2EXT section of this
- chapter, but without specifying any memory parameter at all.
- EMS2EXT will be resident, but it will not allocate any memory. It
- will, however, recognize as its memory a handle with the name
- "EMS2EXT". You can then, as needed, create, grow, or shrink the
- amount of extended memory for this handle using EMS.COM.
-
- This capability should only be used in special situations when
- you know how and when the program will use extended memory. For
- instance, a program could be given extended memory only while it
- is running. You could make a batch file which ran EMS CREATE
- "EMS2EXT" 128K before running the application. When the program
- terminates, another EMS statement could free the memory.
-